home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- * trial.h - exported entry points into the 32 bit Trialware DLL
- ****************************************************************************
- * This module, both in source and in binary format, is wholly owned
- * and hereby expressly copyrighted by Pipeline.
- * Copyright 1994-1996 Pipeline Communications, Inc.
- * All rights reserved.
- ****************************************************************************/
- #ifndef _TRIAL_H
- #define _TRIAL_H
- // trialware status structure
- // used for returns
-
- #if defined(__cplusplus)
- extern "C" {
- #endif
-
- typedef struct _tw_status
- {
- DWORD dwMisc;
- DWORD dwFlags;
- DWORD dwDaysLeft;
- DWORD dwTimeLeft;
- DWORD dwExpDate;
- DWORD dwToken;
- HINSTANCE hInst;
- } TWSTATUS;
-
- typedef TWSTATUS * PTWSTATUS;
-
- #define PLTW_SECURE (0x00000001)
- #define PLTW_SET_DATE (0x00000002)
- #define PLTW_SET_DAYS (0x00000004)
- #define PLTW_ADD_DAYS (0x00000010)
- #define PLTW_NO_ORDER (0x00000020)
- #define PLTW_ORDER_EXE (0x00000040)
- #define PLTW_NO_RESOURCE (0x00000080)
- #define PLTW_READ_ONLY (0x00000100)
- #define PLTW_UNLOCK (0x00000200)
- #define PLTW_FROMORDER (0x00010000)
-
- // Warning! TW_FAILURE is now removed
- // It was misused. There was no distinction between a
- // failed API and EXPIRED trialware.
- //
- // NOW!!! TW_EXPIRED is returned if the trialware is expired.
- // Since much code relied on the return value of 0 (zero)
- // to indicated expired, TW_EXPIRED is 0
- // This way the .dll will be somewhat run time compatible.
-
- // Since TW_FAILURE has been changed to a new VALUE: -1
- // and is really now representative of an ERROR, NOT EXPIRED
- // I purposely undefined TW_FAILURE to produce compile errors.
- // This will give the programmer cause to check the usage of
- // TW_FAILURE in his code and whether he really needs to use
- // TW_EXPIRED or TW_FAILED.
- //
- // Scott Russell
- // 4-6-96
-
- #define TW_INVALID_PARAM (-1)
- #define TW_FAILED (-1)
- #pragma message( "Warning! Trial.dll return codes have changed, See Trial.h Comments" )
- // #define TW_FAILURE (0)
- #define TW_EXPIRED (0) // errors are <= 0
- #define TW_SUCCESS (1)
- #define TW_UNLOCKED (2)
-
- // function prototypes
- // alias the names of the api
- #define StartTrial PLSTW
- #define TestTrial PLTTW
- #define EndTrial PLETW
- int StartTrial(LPCSTR szLogin, PTWSTATUS stat);
- int TestTrial(LPCSTR szLogin, PTWSTATUS stat);
- int EndTrial(LPCSTR szLogin, PTWSTATUS stat);
-
- // macro for decoding secure return
-
- #define XCODE(token, encret, ret) \
- { BYTE *f = (BYTE *)&(token); \
- BYTE *t = (BYTE *)&(encret); \
- int i; \
- for (i = 0; i < 4; i++) \
- *(t+i) = *(f+i) ^ (ret); \
- }
-
- #if defined(__cplusplus)
- }
- #endif
-
- #endif
-